/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 徐海涛
 * Date: 2021-12-12
 * Time: 20:43
 */
public class TestDemo2 {
    public static void main(String[] args) {
    }
    private static void testMethod(){

        System.out.println("testMethod");

    }

    public static void main2(String[] args) {

        ((TestDemo2)null).testMethod();

    }
    //视同while循环建立类似回复模型的异常处理行为，他将不断重复,知道异常不再出现
    public static void main1(String[] args) {
        int i = 0;
        while (i<10) {
            try {
                if(i<10) {
                    throw new Exception();
                }
            }catch (Exception e) {
                e.printStackTrace();
                System.out.println("继续");
                i++;
            }
        }
        System.out.println("终于有网了");
    }
}
